﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using LP580.CG;
using System.Text;

public partial class User_UC1Profile : System.Web.UI.Page
{
    private clsUserAccount ua = clsUserAccount.getCookieUser(true);
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if (Request.QueryString["act"] == "t")
            {
                clsUserCompanyInfo cls = new clsUserCompanyInfo(5);
                cls.CompanyName = Utils.RF_str("tbxCompanyName");
                cls.BuildYear = Utils.RF_str("tbxBuildYear");
                cls.ContactPerson = Utils.RF_str("tbxContactPerson");
                cls.Tel = Utils.RF_str("tbxTel");
                cls.DeptName = Utils.RF_str("tbxDeptName");
                cls.UserPosition = Utils.RF_str("tbxUserPosition");
                cls.Fax = Utils.RF_str("tbxFax");
                cls.Mobile = Utils.RF_str("tbxMobile");
                cls.Email = Utils.RF_str("tbxEmail");
                cls.Website = Utils.RF_str("tbxWebsite");
                cls.CompanyAddress = Utils.RF_str("tbxCompanyAddress");
                cls.CompanyAbout = Utils.RF_str("tbxCompanyAbout");
                clsUserCompanyInfo.Update(cls);
                //Response.Redirect("/user/", true);
            }
            else
            {
                clsUserCompanyInfo cls = new clsUserCompanyInfo(5);
                tbxCompanyName.Value = cls.CompanyName;
                tbxBuildYear.Value = cls.BuildYear;
                tbxContactPerson.Value = cls.ContactPerson;
                tbxTel.Value = cls.Tel;
                tbxDeptName.Value = cls.DeptName;
                tbxUserPosition.Value = cls.UserPosition;
                tbxFax.Value = cls.Fax;
                tbxMobile.Value = cls.Mobile;
                tbxEmail.Value = cls.Email;
                tbxWebsite.Value = cls.Website;
                tbxCompanyAddress.Value = cls.CompanyAddress;
                tbxCompanyAbout.Value = cls.CompanyAbout;
                //StringBuilder sb = new StringBuilder();
                //sb.Append("<em id='dv'>");
                //sb.AppendFormat("<em for='tbxCompanyName' dv='{0}'></em>", cls.CompanyName);
                //sb.AppendFormat("<em for='tbxBuildYear' dv='{0}'></em>", cls.BuildYear);
                //sb.AppendFormat("<em for='tbxContactPerson' dv='{0}'></em>", cls.ContactPerson);
                //sb.AppendFormat("<em for='tbxTel' dv='{0}'></em>", cls.Tel);
                //sb.AppendFormat("<em for='tbxDeptName' dv='{0}'></em>", cls.DeptName);
                //sb.AppendFormat("<em for='tbxUserPosition' dv='{0}'></em>", cls.UserPosition);
                //sb.AppendFormat("<em for='tbxFax' dv='{0}'></em>", cls.Fax);
                //sb.AppendFormat("<em for='tbxMobile' dv='{0}'></em>", cls.Mobile);
                //sb.AppendFormat("<em for='tbxEmail' dv='{0}'></em>", cls.Email);
                //sb.AppendFormat("<em for='tbxWebsite' dv='{0}'></em>", cls.Website);
                //sb.AppendFormat("<em for='tbxCompanyAddress' dv='{0}'></em>", cls.CompanyAddress);
                //sb.AppendFormat("<em for='tbxCompanyType' dv='{0}'></em>", cls.CompanyType);
                //sb.AppendFormat("<em for='tbxRegisteredCapital' dv='{0}'></em>", cls.RegisteredCapital);
                //sb.AppendFormat("<em for='tbxSalesType' dv='{0}'></em>", cls.SalesType);
                //sb.AppendFormat("<em for='tbxSalesItem' dv='{0}'></em>", cls.SalesItem);
                //sb.AppendFormat("<em for='tbxCompanyAbout' dv='{0}'></em>", cls.CompanyAbout);
                //sb.AppendFormat("</em>");
                //Ldv.Text = sb.ToString();
            }
        }
    }
}